<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<view>计数：{{counter.count}}</view>
		<button @click="handleAdd">增加</button>
		<van-button type="primary">主要按钮</van-button>
		<van-icon name="chat-o" />
		<!-- 	<van-cell title="选择单个日期" :value="date" @click="show = true" />
		<van-calendar v-model:show="show" @confirm="onConfirm" /> -->
		<!-- <van-cell is-link @click="showPopup">展示弹出层</van-cell>
		<van-popup v-model:show="show">内容</van-popup>
		<van-loading />
		<van-loading type="spinner" />
		<view class="url">
			{{url}}
		</view> -->
	</view>
</template>

<script setup lang="ts">
	import {
		counterStore
	} from '../../store/counter.js'
	import { ref, getCurrentInstance } from 'vue'
	import { onShow } from '@dcloudio/uni-app'
	import { showToast } from 'vant';

	import type { ComponentInternalInstance } from 'vue'
	const { proxy } = getCurrentInstance() as ComponentInternalInstance

	const counter = counterStore()
	const handleAdd = async () => {
		counter.increment()
		// 使用默认的loading
		const response = await proxy?.$http.get('/auth/tenant/list')
		// 自定义的loading
		const response1 = await proxy?.$http.get('/auth/tenant/list',null,null,'loading')
		console.log("response", response)
	}
	const url = process.env.VUE_APP_TEST
	const title = ref<String>('标题')
	onShow(() => {
		// console.log('onShow')
		// console.log(proxy)

	})
	// const date = ref('');
	// const show = ref(false);

	// const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
	// const onConfirm = (value) => {
	// 	show.value = false;
	// 	date.value = formatDate(value);
	// };
	const show = ref(false);
	const showPopup = () => {
		show.value = true;
	};
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>